package com.framework.integration;

import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
import org.springframework.util.StringUtils;

public class MyMessageFormattingStrategy implements MessageFormattingStrategy {
    @Override
    public String formatMessage(int i, String s, long elapsed, String s1, String sql, String s3) {
        return StringUtils.isEmpty(sql) ? " | 耗时 " + elapsed + " ms | SQL 语句：" + "\n" + sql.replaceAll("[\\s]+", " ") + ";" : "";
    }
}
